import request from '@/utils/request'

export function loadDataUrl() {
  return 'base-service/api/warehouseMng/loadData'
}

export function deleteUrl() {
  return 'base-service/api/warehouseMng/doDelete'
}

export function toAdd(data) {
  return request({
    url: 'base-service/api/warehouseMng/toAdd',
    method: 'post',
    data
  })
}

export function toCopy(data) {
  return request({
    url: 'base-service/api/warehouseMng/toCopy',
    method: 'post',
    data
  })
}

export function viewMainData(data) {
  return request({
    url: 'base-service/api/warehouseMng/toView',
    method: 'post',
    data
  })
}

export function addOrEdit(data) {
  return request({
    url: 'base-service/api/warehouseMng/doSave',
    method: 'post',
    data
  })
}

export function del(data) {
  return request({
    url: 'base-service/api/warehouseMng/doDelete',
    method: 'post',
    data
  })
}

export function getWarehouseByCpyCode(curId) {
  const data = { id: curId }
  return request({
    url: 'base-service/api/warehouseMng/getWarehouseByCpyCode',
    method: 'post',
    data
  })
}
